<template>
  <div class="">
    <el-form ref="ruleForm" :inline="false" class="elForm" :class="isEdit?'':'formItem'">
      <el-card class="box-card" shadow="never">

        <div slot="header" class="header-card" style="display: flex;justify-content: space-between">
          <span class="header-card-title">车辆信息</span>

        </div>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车牌号:">
              <span>{{ ruleForm.carNo }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车架号:">
              <span>{{ ruleForm.vinNo }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="品牌/车型/车款:">
              <span>{{ ruleForm.brandName }}{{ ruleForm.seriesName }}{{ ruleForm.modelName }}</span>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="车辆产权:">
              <span>{{ ruleForm.propertyRightName }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆运营:">
              <span>{{ ruleForm.operationsName }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆归属:">
              <span>{{ ruleForm.ascription }}</span>
            </el-form-item>
          </el-col>

          <!-- <el-col :span="8">
            <el-form-item label="牌照性质:">
              <span>{{ ruleForm.environmentalStandards }}</span>
            </el-form-item>
          </el-col> -->
          <el-col :span="8">
            <el-form-item label="排放标准:">
              <span>  {{ ruleForm.environmentalStandards }}</span>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="登记日期:">
              <span>{{ ruleForm.registerTime }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="申请人:">
              <span>{{ ruleForm.proposer }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="处置单号:">
              <el-button type="text" class="enable-text-select" @click="handleTo(ruleForm)">
                {{ ruleForm.vehicleDisposalNo }}
              </el-button>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="处置类型:">
              <span> {{ selectDictLabel(dict.type.disposal_type, ruleForm.disposalType) }} </span>
            </el-form-item>
          </el-col>
          <!--          <el-col :span="8">-->
          <!--            <el-form-item label="登记类型:">-->
          <!--              <span> </span>-->
          <!--            </el-form-item>-->
          <!--          </el-col>-->
          <el-col :span="8">
            <el-form-item label="工单推送时间:">
              <span>{{ ruleForm.workOrderTime }}</span>
            </el-form-item>
          </el-col>

        </el-row>
      </el-card>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'vehicleMessage',//车辆信息
  dicts: ['disposal_type'],
  props: {
    value: {
      type: Object,
      default: () => {
      }
    },
    state: {
      type: String,
      default: "",
    },
  },
  computed: {
    ruleForm: {
      get() {
        let that = this;
        const proxy = new Proxy(that.value, {
          get(target, key) {
            return Reflect.get(target, key);
          },
          set(target, key, value) {
            that.$emit("input", {...target, [key]: value});
            return true;
          },
        });
        return proxy;
      },
    },
    labelPosition() {
      if (this.state === 'write') {
        return 'top'
      } else {
        return 'right'
      }
    },
    isEdit() {
      let bool;
      switch (this.state) {
        case "write":
          bool = true;
          break;
        case "disabled":
          bool = false;
          break;
        case "readonly":
          bool = false;
          break;
      }
      return bool
    }
  },
  watch: {},
  data() {
    return {};
  },
  created() {
  },
  mounted() {
  },
  methods: {
    handleTo(row) {
      if (row.disposalType === '0') {
        this._toPage({
          path: "/VehicleDisposal/RoutineDisposal/RoutineHandleDetails",
          name: "RoutineHandleDetails",
          query: {
            type: "view",
            path: 'RoutineHandleList',
            id: row.disposalId,
            vehicleDisposalNo:row.vehicleDisposalNo
          },
        });
      }
      if (row.disposalType === '1') {
        this._toPage({
          path: '/VehicleDisposal/ScrapDisposal/ScrapHandleDetails',
          name: 'ScrapHandleDetails',
          query: {
            type: 'view',
            id: row?.disposalId,
          },
        })
      }
      if (row.disposalType === '2') {
        this._toPage({
          path: "/VehicleDisposal/RentPurchaseTransfer/PurchaseHandleDetails",
          name: 'PurchaseHandleDetails',
          query: {
            type: "view",
            id: row?.disposalId,
          }
        })
      }
    },
  },
};
</script>

<style scoped lang=""></style>


